package cn.muqingfeng.api.to;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

public class UserTO implements Parcelable {

	@SerializedName("username")
	private String username;

	@SerializedName("usergroup")
	private String usergroup;

	@SerializedName("uid")
	private String uid;

	@SerializedName("groupid")
	private String groupid;

	@SerializedName("email")
	private String email;

	public UserTO() {
	}

	public UserTO(Parcel source) {
		this.username = source.readString();
		this.usergroup = source.readString();
		this.uid = source.readString();
		this.groupid = source.readString();
		this.email = source.readString();
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(username);
		dest.writeString(usergroup);
		dest.writeString(uid);
		dest.writeString(groupid);
		dest.writeString(email);
	}

	public static final Creator<UserTO> CREATOR = new Creator<UserTO>() {

		@Override
		public UserTO[] newArray(int size) {
			return new UserTO[size];
		}

		@Override
		public UserTO createFromParcel(Parcel source) {
			return new UserTO(source);
		}
	};

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUsergroup() {
		return usergroup;
	}

	public void setUsergroup(String usergroup) {
		this.usergroup = usergroup;
	}

	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getGroupid() {
		return groupid;
	}

	public void setGroupid(String groupid) {
		this.groupid = groupid;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String toGsonString() {
		Gson gson = new Gson();
		return gson.toJson(this);
	}
}
